<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>模板字面量-插入表达式</title>
    </head>
    <body>
        <h1>模板字符串</h1>
        <p>来源:<a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/template_strings">https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/template_strings</a></p>
        <h3>多行字符串</h3>
        <script>
            // 案例一：普通字符串插入表达式
            var a = 5;
            var b = 10;
            console.log('Fifteen is ' + (a + b) + ' and\nnot ' + (2 * a + b) + '.');
            // "Fifteen is 15 and
            // not 20."
            // 案例二：模板字符串插入表达式
            var a = 5;
            var b = 10;
            console.log(`Fifteen is ${a + b} and
                not ${2 * a + b}.`);
        </script>
    </body>
</html>